<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<style type="text/css">
	#right{
		position: absolute;
		left:0px;
		top:0px;
	}
	#stop{
		position: absolute;
		left:600px;
		top:200px;
	}
	#start{
		position: absolute;
		left:600px;
		top:230px;
	}
	</style>
	<script type="text/javascript">	
	window.onload=function  () {
			var box = document.getElementById('right');
			var dog = document.getElementById('dog');
			var left = 0;
			var c =1;
			var run = function run(){
				if(c==1){
					left +=70;
					dog.setAttribute('src', './images/proxy.gif');
				}else{

					left -=70;
					dog.setAttribute('src','./images/proxy_1.gif');
				}
				if(left>1360){
					c=0;
				}else if(left<0){
					c=1;
				}				
				box.style.left=left+'px';
			}

			time = setInterval(run, 200);

			var stop = document.getElementById('stop');
			click  =0;
			stop.onclick = function  () {
				clearTimeout(time);
				click  =0;
			}

			var start = document.getElementById('start');
			
			start.onclick = function  () {
				if(click==0){
					time = setInterval(run, 200);
					click=1;
				}
			}
	}	
	</script>
</head>
<body>
	<div id="right">
		<img id='dog' src="./images/proxy.gif" alt="" >
	</div>
	<input type="button" value="stop" id="stop">
	<input type="button" value="start" id="start">

</html>